package nl.hu.verbrandendephoenix.view;

import java.util.ArrayList;

import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class Login {

	//*ServiceAsync myService = (*ServiceAsync) GWT.create(*Service.class);
	private VerticalPanel pnlLogin;
	private Label lblUsername, lblPassword;
	public TextBox txtUsername;
	public PasswordTextBox txtPassword;
	private Button btnLogin;
	private Anchor ancRegister;
	
	
	public Login() { }
	
	public Panel constructForm() {
		//Login panel
		pnlLogin = new VerticalPanel();
		
		lblUsername = new Label("Gebruikersnaam: ");
		pnlLogin.add(lblUsername);
		txtUsername = new TextBox();
		pnlLogin.add(txtUsername);
		lblPassword = new Label("Wachtwoord: ");
		pnlLogin.add(lblPassword);
		txtPassword = new PasswordTextBox();
		pnlLogin.add(txtPassword);
		btnLogin = new Button("Log in");
		pnlLogin.add(btnLogin);
		ancRegister = new Anchor("Registreer", "#register");
		pnlLogin.add(ancRegister);
	  return pnlLogin;
	}
	/**
	 * Stuurt een arraylist met textboxen terug.
	 * @return ArrayList<TextBox> Een ArrayList met alle TextBoxen uit de view Login.
	 */
	public ArrayList<TextBox> getArrTextBox() {
		ArrayList<TextBox> arrList = new ArrayList<TextBox>();
		arrList.add(txtUsername);
		arrList.add(txtPassword);
	  return arrList;
	}
	/**
	 * Stuurt een login button terug
	 * @return Button de button die wordt teruggestuurd.
	 */
	public Button getBtnLogin() {
	  return btnLogin;
	}

	public TextBox getTxtUsername() {
		return txtUsername;
	}

	public TextBox getTxtPassword() {
		return txtPassword;
	}
}
